package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.pro.constant.I18nStringConstant;
import lombok.Getter;

/**
 * @author: yingjf
 * @date: 2022/8/23 09:46
 * @description: 竞争对手全景图
 */
@Getter
public enum CompetitorPanoramaEnum {
    OPPORTUNITY_COUNT("opportunityCount","enum.competitorPanorama.name.opportunityCount","competitorLinkedOpportunity","enum.unit.name.number"),
    OPPORTUNITY_MONEY("opportunityMoney","enum.competitorPanorama.name.opportunityMoney",null,"enum.unit.name.money"),
    WIN_OPPORTUNITY_COUNT("winOpportunityCount","enum.competitorPanorama.name.winOpportunityCount","competitorLinkedOpportunity","enum.unit.name.number"),
    WIN_OPPORTUNITY_MONEY("winOpportunityMoney","enum.competitorPanorama.name.winOpportunityMoney",null,"enum.unit.name.money"),
    LOSE_OPPORTUNITY_COUNT("loseOpportunityCount","enum.competitorPanorama.name.loseOpportunityCount","competitorLinkedOpportunity","enum.unit.name.number"),
    LOSE_OPPORTUNITY_MONEY("loseOpportunityMoney","enum.competitorPanorama.name.loseOpportunityMoney",null,"enum.unit.name.money"),
    ;

    /**
     * 字段属性
     */
    private String attr;
    /**
     * 字段名
     */
    private String name;
    /**
     * 穿透的详情页tab英文名，如果改值为null或空字符串，则不能穿透
     */
    private String detailKey;
    /**
     * 单位
     */
    private String unit;

    CompetitorPanoramaEnum(String attr, String name, String detailKey, String unit) {
        this.attr = attr;
        this.name = name;
        this.detailKey = detailKey;
        this.unit = unit;
    }

    public String getName(String saleOpportunityMenuName) {
        return String.format(I18nMessageUtil.getMessage(name), saleOpportunityMenuName);
    }
    public String getUnit() {
        return I18nMessageUtil.getMessage(unit);
    }

}
